Add definitions for the new HTTP QUERY method per RFC 10008 - #3654
Conversation
Lukasa
left a comment
There was a problem hiding this comment.
So I think we can't take this per our current rules. However, it would be interesting to investigate whether the nonexhaustive enum feature can be retroactively added without breaking the API. If it can then we could consider making the enum nonexhaustive, which would resolve our problem.
|
Definitely worth investigating, I will look into that! But there is the caveat that SE-0487 didn't land until Swift 6.2.3, so at minimum it would have to wait for the release of Swift 6.4 so that NIO can require 6.2 as a minimum supported version. |
|
So I actually went and read SE-0487 more closely, and unfortunately it explicitly states that adding Weren't you one of the authors of SE-0487? 🤨 |
|
Yeah you cannot add It might be worth doing a Github search seeing how many packages actually exhaustively switch over this to evaluate if we might get away with a potential break here. |
|
Yeah, that was exactly my thinking—how many people are actually exhaustively switching over the list of HTTP methods? I wouldn't call it conclusive yet, but with a cursory Github search, I so far can't find anyone doing it, other than the tests in forks of NIO. |
Adds definitions for the
QUERYmethod defined in RFC 10008 toHTTPMethod.Motivation:
The method has already been added to swift-http-types; this addition maintains parity for SwiftNIO.
Modifications:
The method definition has been added to
HTTPMethodand marked as always having a request body. Awareness of it was also added toHTTPDecoder, as thellhttplibrary already has a constant defined for it.Result:
The new definition becomes publicly available.
enumnot marked with@nonexhaustiveis technically considered a source-breaking change. I believe the risk of actual compatibility issues for this change is minimal, as it seems unlikely that clients would be functionally making use ofHTTPMethodin an exhaustive fashion, but I recognize that this PR may nonetheless be rejected on that basis.